var article = require('../models/ArticleModel');
var funs    = require('../fun/functions');
exports.setupList = function(req,res){
	var className = req.params.class;
	var page      = req.query.p?req.query.p:1;
	var where = {className:className,'page':page,'num':16}
    article.getArticleByClassLimit(where,function(data){
    	article.getArticleCountByClass(className,function(count){
    		 var allcount = 0
	     		if(typeof(count) != "undefined"){
	     			allcount = count[0].count
	     		}
    		 var show = funs.getPage(req,allcount,16,{'class':className});
             res.render('setup',{list:data,page:show,className:className})
    	})
    	
    })
}